home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / ace_gpl_release / src / lib / asm / gfx.s < prev    next >
Encoding:
Text File  |  1998-10-04  |  12.8 KB  |  655 lines

  1. ;
  2. ; gfx.s -- an ACE linked library module: graphics functions.
  3. ; Copyright (C) 1998 David Benn
  4. ; This program is free software; you can redistribute it and/or
  5. ; modify it under the terms of the GNU General Public License
  6. ; as published by the Free Software Foundation; either version 2
  7. ; of the License, or (at your option) any later version.
  8. ;
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ; GNU General Public License for more details.
  13. ;
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  17. ;
  18. ; Author: David J Benn
  19. ;   Date: 3rd-30th November, 1st-13th December 1991,
  20. ;      20th, 23rd,25th-27th January 1992, 
  21. ;         2nd,4th,6th,12th-19th,21st-24th,29th February 1992,
  22. ;      1st,14th March 1992,
  23. ;      4th,7th,21st,22nd,26th April 1992,
  24. ;      2nd,3rd,5th,7th,8th,10th-17th May 1992,
  25. ;      6th,8th,11th,12th,28th,30th June 1992,
  26. ;      1st-3rd,13th,14th,18th-20th,22nd July 1992,
  27. ;      9th August 1992,
  28. ;      5th,12th,13th December 1992,
  29. ;      20th,21st January 1993,
  30. ;      1st March 1993,
  31. ;      19th March 1994
  32. ;
  33. ; registers d0-d6 and a0-a3 are modified by some of the following. BEWARE!
  34. ;
  35. ; a4,a5 are used by link/unlk.
  36. ; a6 is library base holder.
  37. ; a7 is stack pointer. 
  38. ; d7 is used for array index calculations.
  39. ;
  40.  
  41. ;* RastPort CONSTANTS *
  42. AreaInfo    EQU    16
  43. TmpRas        EQU    12
  44. LinePtrn    EQU    34
  45. AOlPen        EQU    27
  46. Flags        EQU    32
  47. linepatcnt    EQU    30
  48. AreaPtrn    EQU    8
  49. AreaPtSz    EQU    29
  50.  
  51.     ; graphics routines
  52.     xdef    _ellipse
  53.     xdef    _paint
  54.     xdef    _area
  55.     xdef    _areafill
  56.     xdef    _last_areaX
  57.     xdef    _last_areaY
  58.     xdef    _linepattern
  59.     xdef    _areapattern
  60.  
  61.        ; external references
  62.     xref    _radconv
  63.  
  64.     xref    _GfxBase
  65.     xref    _RPort
  66.     xref    _fgdpen
  67.     xref    _LVOWritePixel
  68.     xref    _LVODrawEllipse
  69.     xref    _LVOSetAPen
  70.     xref    _LVOInitArea
  71.     xref    _LVOAllocRaster
  72.     xref    _LVOFreeRaster
  73.     xref    _LVOInitTmpRas
  74.     xref    _LVOFlood
  75.     xref    _LVOAreaDraw
  76.     xref    _LVOAreaEnd
  77.     xref    _LVOAreaMove
  78.     xref    _windowfunc
  79.     xref    _MathBase
  80.     xref    _MathTransBase
  81.     xref    _LVOSPFix
  82.     xref    _LVOSPFlt
  83.     xref    _LVOSPFloor
  84.     xref    _LVOSPAdd
  85.     xref    _LVOSPMul
  86.     xref    _LVOSPDiv
  87.     xref    _LVOSPCmp
  88.     xref    _LVOSPCos
  89.     xref    _LVOSPSin
  90.     xref    _LVOSPLog
  91.  
  92.     SECTION graphics_code,CODE
  93.  
  94. ;
  95. ; ELLIPSE - draw a circle or ellipse. 
  96. ;        d0=x,d1=y,d2=radius,d3=start,d4=end,d5=aspect.
  97. ;
  98. ;      - if full ellipse (0-359 degs) -> use DrawEllipse()
  99. ;        otherwise use my own ellipse algorithm (ie: for arcs).
  100. ;
  101. _ellipse:
  102.     ; store parameters
  103.     move.l    d0,_x
  104.     move.l    d1,_y
  105.     move.l    d2,_radius
  106.     move.l    d3,_startangle
  107.     move.l    d4,_endangle
  108.     move.l    d5,_aspect
  109.     
  110.     ; * is it a full ellipse? *
  111.     
  112.     ; start angle=0? (start must = 0 AND end must = 359)
  113.     cmpi.l    #0,d3
  114.     bne    _do_my_ellipse        ; start <> 0 -> use my algorithm
  115.     
  116.     ; end angle=359?
  117.     movea.l    _MathBase,a6
  118.     move.l    d4,d0
  119.     move.l    #$b3800049,d1        ; 359 (FFP)
  120.     jsr    _LVOSPCmp(a6)
  121.     bne    _do_my_ellipse        ; end <> 359 -> use my algorithm
  122.  
  123.     ; * use faster DrawEllipse() *
  124.     
  125.     ; make x and y integers
  126.     move.l    _x,d0
  127.     jsr    _LVOSPFix(a6)
  128.     move.l    d0,_x
  129.     
  130.     move.l    _y,d0
  131.     jsr    _LVOSPFix(a6)
  132.     move.l    d0,_y
  133.     
  134.     ; calculate x radius and coerce
  135.     move.l    _radius,d0
  136.     move.l    _aspect,d1
  137.     jsr    _LVOSPDiv(a6)
  138.     jsr    _LVOSPFix(a6)
  139.     move.l    d0,_xradius
  140.  
  141.     ; coerce radius 
  142.     move.l    _radius,d0
  143.     jsr    _LVOSPFix(a6)
  144.     cmpi.l    #0,d0
  145.     bne.s    _store_radius
  146.     add.l    #1,_radius        ; vertical radius must be > 0
  147. _store_radius:
  148.     move.l    d0,_radius
  149.  
  150.     ; draw ellipse
  151.     movea.l    _GfxBase,a6    
  152.     move.l    _RPort,a1
  153.     move.l    _x,d0
  154.     and.w    #$ffff,d0
  155.     move.l    _y,d1
  156.     and.w    #$ffff,d1
  157.     move.l    _xradius,d2
  158.     and.w    #$ffff,d2
  159.     move.l    _radius,d3
  160.     and.w    #$ffff,d3
  161.     jsr    _LVODrawEllipse(a6)
  162.  
  163.     rts
  164.     
  165. _do_my_ellipse:    
  166.     ; calculate x-radius based upon aspect and radius
  167.     move.l    _radius,d0
  168.     move.l    _aspect,d1
  169.     movea.l    _MathBase,a6
  170.     jsr    _LVOSPDiv(a6)
  171.     move.l    d0,_xradius
  172.  
  173.     ; initial loop value 
  174.     move.l    _startangle,_theta
  175.  
  176. _plotellipse:
  177.     ; calculate x-point (x-point = x + xradius*cos(theta/radconv)
  178.     move.l    _theta,d0
  179.     move.l    _radconv,d1
  180.     movea.l    _MathBase,a6
  181.     jsr    _LVOSPDiv(a6)
  182.     movea.l    _MathTransBase,a6
  183.     jsr    _LVOSPCos(a6)
  184.     move.l    _xradius,d1
  185.     movea.l    _MathBase,a6
  186.     jsr    _LVOSPMul(a6)
  187.     move.l    _x,d1
  188.     jsr    _LVOSPAdd(a6)
  189.     jsr    _LVOSPFix(a6)
  190. ;    and.w    #$ffff,d0
  191.     move.w    d0,_outx
  192.  
  193.     ; calculate y-point (y-point = y + radius*sin(theta/radconv)
  194.     move.l    _theta,d0
  195.     move.l    _radconv,d1
  196.     movea.l    _MathBase,a6
  197.     jsr    _LVOSPDiv(a6)
  198.     movea.l    _MathTransBase,a6
  199.     jsr    _LVOSPSin(a6)
  200.     move.l    _radius,d1
  201.     movea.l    _MathBase,a6
  202.     jsr    _LVOSPMul(a6)
  203.     move.l    _y,d1
  204.     jsr    _LVOSPAdd(a6)
  205.     jsr    _LVOSPFix(a6)
  206. ;    and.w    #$ffff,d0
  207.     move.w    d0,_outy
  208.     
  209.     ; plot point
  210.     movea.l    _RPort,a1
  211.     move.w    _outx,d0
  212.     move.w    _outy,d1
  213.     movea.l    _GfxBase,a6
  214.     jsr    _LVOWritePixel(a6)
  215.  
  216.     ; increment angle by .5
  217.      move.l    _theta,d0
  218.     move.l    #$80000040,d1
  219.     movea.l    _MathBase,a6
  220.     jsr    _LVOSPAdd(a6)
  221.     move.l    d0,_theta
  222.  
  223.     ; still more to do?  (is theta <= endangle?)
  224.     move.l    _theta,d0
  225.     move.l    _endangle,d1
  226.     jsr    _LVOSPCmp(a6)
  227.     ble    _plotellipse
  228.  
  229.     rts
  230.  
  231. ;
  232. ; RASSIZE     - d0=x,d1=y
  233. ;        - result returned in d0
  234. ;        - see graphics/gfx.h
  235. ;
  236. _rassize:
  237.     add.l    #15,d0
  238.     asr.l    #3,d0
  239.     and.w    #$fffe,d0
  240.     and.w    #$ffff,d1
  241.     mulu    d1,d0    
  242.     rts
  243.  
  244. ;
  245. ; PAINT. d0=X,d1=Y,d2=paintcolor-id,d3=bordercolor-id.
  246. ;
  247. _paint:
  248.     ; store coordinates.
  249.     move.w    d0,_paint_x
  250.     move.w    d1,_paint_y
  251.     
  252.     ; store old fgdpen
  253.     move.w    _fgdpen,_oldfgdpen
  254.         
  255.     ; check colours
  256.     cmpi.w    #-1,d2
  257.     bne.s    _checkbordercolr
  258.     move.w    _fgdpen,d2    ; if paintcolor-id=-1 
  259.                 ; -> paintcolor-id=_fgdpen    
  260.  
  261. _checkbordercolr:
  262.     cmpi.w    #-1,d3
  263.     bne.s    _storecolrs
  264.     move.w    d2,d3        ; if bordercolor-id=-1 
  265.                 ; -> bordercolor-id=_fgdpen
  266.  
  267. _storecolrs:
  268.     move.w    d2,_paintcolr
  269.     move.w    d3,_bordercolr
  270.     
  271.     ; initialise a vector collection matrix.
  272. ;    movea.l    _GfxBase,a6
  273. ;    lea    _ainfo,a0
  274. ;    lea    _areabuf,a1
  275. ;    move.w    #160,d0        ; ???
  276. ;    jsr    _LVOInitArea(a6)
  277. ;    movea.l    _RPort,a0
  278. ;    move.l    #_ainfo,AreaInfo(a0)
  279.     
  280.     ; allocate space for a bitplane
  281.     move.w    #2,d0
  282.     jsr    _windowfunc
  283.     move.l    d0,_WdwWidth    ; get width of current window
  284.  
  285.     move.w    #3,d0
  286.     jsr    _windowfunc
  287.     move.l    d0,_WdwHeight    ; get height of current window
  288.  
  289.     movea.l    _GfxBase,a6
  290.     move.l    _WdwWidth,d0
  291.     move.l    _WdwHeight,d1
  292.     jsr    _LVOAllocRaster(a6)
  293.     move.l    d0,_tbuf    ; store planeptr
  294.     cmpi.l    #0,d0
  295.     beq    _quitpaint    ; quit if can't allocate space.
  296.  
  297.     ; initialise area of local memory for Flood()
  298.     movea.l    _GfxBase,a6
  299.     lea    _tras,a0
  300.     move.l    _tbuf,a1
  301.     move.l    _WdwWidth,d0
  302.     move.l    _WdwHeight,d1
  303.     jsr    _rassize
  304.     jsr    _LVOInitTmpRas(a6)
  305.     movea.l    _RPort,a0
  306.     move.l    #_tras,TmpRas(a0)    ; store pointer to TmpRas
  307.  
  308.     ; set border and foreground pens
  309.     move.l    _RPort,a0
  310.  
  311.     move.b    AOlPen(a0),_oldbordercolr
  312.     move.w    _bordercolr,d0
  313.     and.b    #$ff,d0
  314.     move.b    d0,AOlPen(a0)     ; set outline pen
  315.     ori.w    #$0008,Flags(a0) ; set areaoutline flag 
  316.                  ; (see graphics/gfxmacros.h)
  317.  
  318.     move.w    _paintcolr,d0
  319.     and.b    #$ff,d0
  320.     move.l    _RPort,a1
  321.     movea.l    _GfxBase,a6
  322.     jsr    _LVOSetAPen(a6)
  323.  
  324.     ; flood area enclosed by bordercolr
  325.     movea.l    _GfxBase,a6
  326.     move.l    _RPort,a1
  327.     move.l    #0,d2        ; mode=fill all adjacent pixels 
  328.                 ; searching for border.
  329.     move.w    _paint_x,d0
  330.     move.w    _paint_y,d1
  331.     jsr    _LVOFlood(a6)
  332.  
  333.     ; reset foreground pen
  334.     move.w    _oldfgdpen,d0
  335.     and.b    #$ff,d0
  336.     move.l    _RPort,a1
  337.     movea.l    _GfxBase,a6
  338.     jsr    _LVOSetAPen(a6)
  339.  
  340.     ; reset border color
  341.     movea.l    _RPort,a0    
  342.     move.b    _oldbordercolr,AOlPen(a0) ; set outline pen
  343.     ori.w    #$0008,Flags(a0)        ; set areaoutline flag 
  344.                         ; (see graphics/gfxmacros.h)
  345.  
  346.     ; free TmpRas memory
  347.     movea.l    _GfxBase,a6
  348.     move.l    _tbuf,a0
  349.     move.l    _WdwWidth,d0
  350.     move.l    _WdwHeight,d1
  351.     jsr    _LVOFreeRaster(a6)
  352.     
  353. _quitpaint:
  354.     movea.l    _RPort,a0
  355.     move.l    #0,TmpRas(a0)
  356.     rts    
  357.  
  358. ;
  359. ; AREA - d0=x,d1=y.
  360. ;
  361. _area:
  362.     ; 20 points already?
  363.     move.l    _areaptcount,d2
  364.     cmpi.l    #20,d2
  365.     beq    _quitarea
  366.  
  367.     ; store x,y
  368.     move.w    d0,_areaX
  369.     move.w    d1,_areaY
  370.     
  371.     ; has at least 1 point already been defined?
  372.     cmpi.l    #1,_areaptcount
  373.     bge.s    _add_coord_to_area    ; yes -> just add point to area info
  374.  
  375.     ; initialise rastport's AreaInfo structure
  376.     movea.l    _GfxBase,a6
  377.     lea    _areainfo,a0
  378.     lea    _areabuffer,a1
  379.     move.w    #21,d0        ; 20 points (need 20 + 1 for this to work)
  380.     jsr    _LVOInitArea(a6)
  381.     movea.l    _RPort,a0
  382.     move.l    #_areainfo,AreaInfo(a0)    ; Rastport->AreaInfo = areainfo
  383.     
  384.     ; first point of area
  385.     movea.l    _GfxBase,a6
  386.     movea.l    _RPort,a1
  387.     move.w    _areaX,d0
  388.     move.w    _areaY,d1
  389.     jsr    _LVOAreaMove(a6)
  390.  
  391.     bra.s    _increment_pt_count            
  392.     
  393. _add_coord_to_area:
  394.     ; add point to area info
  395.        ; (if no room left for another point, AreaDraw will return -1)
  396.     movea.l    _GfxBase,a6
  397.     movea.l    _RPort,a1
  398.     move.w    _areaX,d0
  399.     move.w    _areaY,d1
  400.     jsr    _LVOAreaDraw(a6)
  401.  
  402. _increment_pt_count:
  403.     ; was AreaDraw/Move was successful?
  404.       cmpi.l    #0,d0
  405.     bne.s    _quitarea    
  406.  
  407.     ; increment point counter
  408.     add.l    #1,_areaptcount        
  409.  
  410.     ; store last X & Y
  411.     move.w    _areaX,_last_areaX
  412.     move.w    _areaY,_last_areaY
  413.  
  414. _quitarea:
  415.     rts
  416.  
  417. ;
  418. ; AREAFILL - d0=mode.
  419. ;
  420. _areafill:
  421. ;    bra    _quitareafill
  422.  
  423.     ; save current pen
  424.     move.w    _fgdpen,_oldfgdpen
  425.  
  426.     ; check mode (0=fill normally; 1=fill with inverted color)
  427.     cmpi.w    #0,d0
  428.     beq.s    _justfillarea
  429.     
  430.     ; change foreground pen to max-color-id - fdgpen
  431.     move.l    #6,d0
  432.     jsr    _windowfunc    ; d0 = max-color-id for Rasport
  433.     
  434.     move.w    _fgdpen,d1
  435.     ext.l    d1
  436.     sub.l    d1,d0        ; d0 = d0 - _fgdpen
  437.  
  438.     movea.l    _GfxBase,a6
  439.     movea.l    _RPort,a1
  440.     jsr    _LVOSetAPen(a6)
  441.     
  442. _justfillarea:
  443.     ; have at least 2 points been defined?
  444.     cmpi.l    #2,_areaptcount
  445.     blt    _quitareafill    ; no -> go no further
  446.  
  447.     ; initialise rastport's TmpRas structure    
  448.     move.w    #2,d0
  449.     jsr    _windowfunc
  450.     move.l    d0,_WdwWidth    ; get width of current window
  451.  
  452.     move.w    #3,d0
  453.     jsr    _windowfunc
  454.     move.l    d0,_WdwHeight    ; get height of current window
  455.  
  456.     movea.l    _GfxBase,a6
  457.     move.l    _WdwWidth,d0
  458.     move.l    _WdwHeight,d1
  459.     jsr    _LVOAllocRaster(a6)
  460.     cmpi.l    #0,d0
  461.     beq    _quitareafill
  462.     move.l    d0,_TRBuf    ; store pointer to buffer
  463.  
  464.     movea.l    _GfxBase,a6
  465.     move.l    _WdwWidth,d0
  466.     move.l    _WdwHeight,d1
  467.     jsr    _rassize    ; result in d0 = plane size in bytes (not bits!)
  468.     lea    _tmpras,a0
  469.     movea.l    _TRBuf,a1
  470.     jsr    _LVOInitTmpRas(a6)
  471.     movea.l    _RPort,a0
  472.     move.l    #_tmpras,TmpRas(a0)    ; Rastport->TmpRas = tmpras    
  473.  
  474.     ; ** fill defined area! **
  475.     movea.l    _GfxBase,a6
  476.     movea.l    _RPort,a1
  477.     jsr    _LVOAreaEnd(a6)
  478.  
  479.     ; restore old fgnd color
  480.     movea.l    _GfxBase,a6
  481.     movea.l    _RPort,a1
  482.     move.w    _oldfgdpen,d0
  483.     ext.l    d0
  484.     jsr    _LVOSetAPen(a6)
  485.     move.w    _oldfgdpen,_fgdpen
  486.  
  487.     ; free buffer
  488.     movea.l    _GfxBase,a6
  489.     movea.l    _TRBuf,a0
  490.     move.l    _WdwWidth,d0
  491.     move.l    _WdwHeight,d1    
  492.     jsr    _LVOFreeRaster(a6)
  493.         
  494. _quitareafill:
  495.     ; get ready for next area
  496.     move.l    #0,_areaptcount    ; # of points = 0
  497.     movea.l    _RPort,a0
  498.     move.l    #0,TmpRas(a0)    ; Rp->TmpRas = NULL
  499.     move.l    #0,AreaInfo(a0)    ; Rp->AreaInfo = NULL
  500.     rts
  501.  
  502. ;
  503. ; PATTERN - linepattern: d0=line-pattern.
  504. ;             d1=RESTORE flag.
  505. ;
  506. ;      - see graphics/gfxmacros.h: SetDrPt()
  507. ;
  508. _linepattern:
  509.     ; get current RastPort
  510.     movea.l    _RPort,a1
  511.  
  512.     ; new line pattern or restore default?
  513.     cmpi.l    #0,d1
  514.     beq.s    _newlinepattern
  515.  
  516.     ; restore default
  517.     move.w    #$ffff,LinePtrn(a1)
  518.     bra.s    _finishlinepattern
  519.  
  520. _newlinepattern:
  521.     move.w    d0,LinePtrn(a1)
  522.  
  523. _finishlinepattern:
  524.     ori.w    #$0001,Flags(a1)
  525.     move.b    #15,linepatcnt(a1)
  526.  
  527.     rts
  528.  
  529. ;
  530. ; PATTERN - areapattern: a0=address of area-pattern array.
  531. ;             d0=size of area-pattern array.
  532. ;             d1=RESTORE flag.
  533. ;
  534. ;      - see graphics/gfxmacros.h: SetAfPt()  
  535. ;        and "Inside Amiga Graphics", pp 116,117
  536. ;
  537. _areapattern:
  538.     ; new area pattern or restore default?
  539.     cmpi.l    #0,d1
  540.     beq.s    _newareapattern
  541.  
  542.     ; restore default
  543.     movea.l    _RPort,a1
  544.     move.l    #_default_area_pat,AreaPtrn(a1)
  545.     move.b    #0,AreaPtSz(a1)    ; height = 2^0 = 1 (ie: height in short words)
  546.     bra.s    _exitareapattern
  547.  
  548. _newareapattern:
  549.     move.l    a0,AreaPtrn(a1)    ; address of area pattern array    
  550.  
  551.     ; find Log2(size): LogE(areapat_size) / LogE(2)
  552.     movea.l    _MathBase,a6
  553.     jsr    _LVOSPFlt(a6)    ; d0 = (float)d0
  554.     movea.l    _MathTransBase,a6
  555.     jsr    _LVOSPLog(a6)
  556.     move.l    d0,-(sp)    ; save result of LogE(size)
  557.  
  558.     move.l    #$80000042,d0    ; 2.0
  559.     jsr    _LVOSPLog(a6)
  560.  
  561.     move.l    d0,d1        ; LogE(2)
  562.     move.l    (sp)+,d0    ; LogE(size)
  563.     movea.l    _MathBase,a6
  564.     jsr    _LVOSPDiv(a6)
  565.  
  566.     jsr    _LVOSPFloor(a6)    ; round it
  567.     jsr    _LVOSPFix(a6)    ; d0 = (long)d0
  568.  
  569.     movea.l    _RPort,a1
  570.     move.b    d0,AreaPtSz(a1)    ; height = 2^d0            
  571.         
  572. _exitareapattern:
  573.     rts
  574.  
  575. ;*********************************
  576.  
  577.     SECTION graphics_data,DATA
  578.  
  579. ; * paint *
  580. _tras:            
  581.     dc.l 0
  582.     dc.l 0
  583.  
  584. _ainfo:    
  585.     dc.l 0
  586.     dc.l 0
  587.     dc.l 0
  588.     dc.l 0
  589.     dc.w 0
  590.     dc.w 0
  591.     dc.w 0
  592.     dc.w 0
  593.  
  594. ; * area *
  595. _areainfo:
  596.     dc.l 0
  597.     dc.l 0
  598.     dc.l 0
  599.     dc.l 0
  600.     dc.w 0
  601.     dc.w 0
  602.     dc.w 0
  603.     dc.w 0
  604.     
  605. _tmpras:    
  606.     dc.l 0
  607.     dc.l 0
  608.  
  609. _areaptcount:    dc.l 0    ; has an area been started?        
  610.  
  611. ; * pattern *
  612. _default_area_pat:    dc.w $ffff
  613.  
  614. ;************************
  615.  
  616.     SECTION graphics_mem,BSS
  617.  
  618. ; * general *
  619. _WdwWidth:        ds.l 1
  620. _WdwHeight:        ds.l 1
  621.  
  622. ; * ellipse *
  623. _x:            ds.l 1
  624. _y:            ds.l 1
  625. _radius:        ds.l 1
  626. _xradius:        ds.l 1
  627. _startangle:        ds.l 1
  628. _endangle:        ds.l 1
  629. _aspect:        ds.l 1
  630. _theta:            ds.l 1
  631. _outx:            ds.w 1
  632. _outy:            ds.w 1
  633.  
  634. ; * paint *
  635. _areabuf:        ds.w 800
  636. _tbuf:            ds.l 1
  637. _paintcolr:        ds.w 1
  638. _bordercolr:        ds.w 1
  639. _oldbordercolr:        ds.b 1
  640. _paint_x:        ds.w 1
  641. _paint_y:        ds.w 1
  642. _oldfgdpen:        ds.w 1
  643. _border:        ds.w 1
  644.  
  645. ; * area *
  646. _areabuffer:        ds.w 53        ; buffer for 20+1 SHORT points (21x2.5)
  647. _areaX:            ds.w 1
  648. _areaY:            ds.w 1
  649. _last_areaX:        ds.w 1          
  650. _last_areaY:        ds.w 1      ; _last_areaX/Y    for use by AREA STEP...
  651. _TRBuf:            ds.l 1
  652.  
  653.     END
  654.